<p style="margin-bottom: 0px">&nbsp;</p>
<nz-card>    
    <form nz-form [nzLayout]="'inline'" class="search__form">
        <nz-row [nzGutter]="8">
            <nz-col nzMd="6" nzSm="24">
                <nz-form-item>
                    <nz-form-label nzFor="sap">{{'sap' | translate}}</nz-form-label>
                    <nz-form-control>
                        <input nz-input [(ngModel)]="q.sap" name="sap" id="sap">
                    </nz-form-control>
                </nz-form-item>
            </nz-col>
           
            <nz-col nzMd="18" nzSm="24">
                <!-- st.load(1, q) -->
                <button nz-button type="button" [nzType]="'primary'" (click)="st.load(1, q)">{{'search' | translate}}</button>
                <button [nzLoading]="syncing" [nzTitle]="'上次执行时间  '+lastDate" 
                    nz-tooltip nz-button nzType='default' style="margin-right: 8px" (click)="syncStock()">
                    {{syncing ? "计算中" : "刷新报表数据"}}
                </button> 
                <span class="text-primary-light">报表每隔半小时刷新一次数据; 也可单击<code>刷新报表数据</code>按钮手动刷新</span>
            </nz-col>
        </nz-row>
    </form>
</nz-card>
<div class="d-flex align-items-center" style="margin-bottom: 8px">
    <div>
      <button nz-button nzType='default' style="margin-right: 8px" (click)="export()">
        <i class="anticon anticon-export"></i>导出
      </button>    
    </div>
</div>        
<simple-table #st
  [columns]="columns"
  [data]="url"
  [ps]="ps"
  [extraParams]="q"
  [resReName]="{ total: 'data.total', list: 'data.rows'}"
  [reqReName]="{pi:'pageNumber', ps: 'pageSize'}"
  toTopInChange="false"
  [showTotal]="true"
  [showPagination]="true"
  [showSizeChanger]="true"
  (checkboxChange)="checkboxChange($event)">   
  <ng-template st-row="ed" let-item let-index="index">
    {{item.qty - item.stock}}
  </ng-template>  
</simple-table> 


